Loading...
 

SendMsg(, SUPER)

SendMessage(, SUPER)

SendMsg(, SUPER)

Stack
Stack Position Description
Stack(In) Top any
Top 1 ...
Stack(Out) Top -

Messages defined in a base module are inherited; however, in the derived module the actions for the same message can be redefined. In this case, SendMsg performs the actions in the derived module.
The instruction sequence hidden by the overdefined message can be reached with SendMsg(, SUPER):

 sendmsg.bmp (497650 Byte)

SendMsg(ALFA) triggers - using the SendMsg(, SUPER) statement - the statementsS1a, S2a,S1b, S3a, while SendMsg(BETA) simply executes statement S4b.

It is intended that no message is specified for SendMsg(, SUPER). Constructions like the following

 sendmsg2.bmp (567022 Byte)

should be prevented.

Examples:

Module(order_web, HELP("order.htm#web")): order
[
  INITIALIZE: SendMsg(, SUPER) // call the INITIALIZE Message of the module this is derived from!

              // The variable defaultTitle has been set in the default INITIALIZE. Now we can change it!

              "Web application" -> defaultTitle
]

// SendMsg(, SUPER) can also be used on widgets! The SELECT Event in ClassiX is also a message!

ObjectCombobox(SubMonitor, LIST_INVALID, LIST_ORIGIN, AUTO_POSITION, NULL_ELEMENT, 10, 10, 300, 80)
[ SELECT: [] SetSort(, ListBox)  // Clear the sorting of the list box

          SendMsg(, SUPER) // Now call the SELECT event of the module, this is derived from!

          // Now the main SELECT event has been executed, change the list sort now again!
          [
            "call(DestinationType)"
            "call(SupplierNameToSortBy)"
            "call(UniqueIDLeft6ToSortBy)"
            "call(Receiver)"
          ]
          SetSort(, ListBox) Sort(, ListBox)
]

This works similarly for macros:

The macro "SaveObject" is defined in the "order" module.
In the module order_web this "SaveObject" is to be used, but supplemented by a check:

Define(SaveObject)
  // First, do some checks, that are not in the default SaveObject macro!
 
GetValue(, orderTypeEnum) Integer 3 = if
  {
    GetValue(, checked.settings) ifnot
    {
      T("Bei Gew„hrleistungsauftr„gen muss die Kostenübernahme aktiviert sein!",
        "On guarantee orders the cost checkbox must be set!")
      Attention(AbortTXN) cancel
    }
  }
  super::SaveObject // Now call the default SaveObject macro from the module, this is derived from!

Also, the super::SaveObject could be placed anywhere else in the macro, even within an "if" statement:

Define(SaveObject)
  // Check, if the default SaveObject macro has to be called, or not.
 
GetValue(, orderTypeEnum) Integer 1 = if
  {
    // Now call the default SaveObject macro from the module, this is derived from!
    super::SaveObject    

    return
  }
  // If the order type is not 1, don't call the default saveObject macro!
 
order DrainWindow
;

See also

Further examples can be found here.